CPPFLAGS = -fPIC -I /usr/local/include/jthread -I ../../apr/Libs/include -L /usr/local/lib -L ../../apr/Libs/lib 

objects = rtcpapppacket.o rtcpbyepacket.o rtcpcompoundpacket.o rtcpcompoundpacketbuilder.o\
rtcppacket.o rtcppacketbuilder.o rtcprrpacket.o rtcpscheduler.o\
rtcpsdesinfo.o rtcpsdespacket.o rtcpsrpacket.o rtpbyteaddress.o rtpcollisionlist.o rtpdebug.o rtperrors.o rtpexternaltransmitter.o rtpinternalsourcedata.o rtpipv4address.o rtpipv6address.o rtplibraryversion.o rtppacket.o rtppacketbuilder.o rtppollthread.o rtprandom.o rtprandomrand48.o rtprandomrands.o rtprandomurandom.o rtpsession.o rtpsessionparams.o rtpsessionsources.o rtpsourcedata.o rtpsources.o rtptcpv4transmitter.o rtptimeutilities.o rtpudpv4transmitter.o rtpudpv6transmitter.o 

moveinclude: jrtp.a 
	cp -f -p libjrtp.so ../../../../bin/release/
	cp -f -p libjrtp.so ../../../../bin/release/PMServer/
	cp -f -p libjrtp.so ../../../../bin/release/MServer/
	
	cp -f -p libjrtp.so ../../../../bin/release/RSServer/
	cp -f -p libjrtp.so ../../../../bin/release/DecOnWallServer/
	cp -f -p libjrtp.so ../../../../bin/release/AlmCenterServer/
	cp -f -p libjrtp.so ../../../../bin/release/DevServer/
	cp -f -p libjrtp.so ../../../../bin/release/NMServer/
	cp -f -p libjrtp.so ../../../../bin/release/GuardServer/
	cp -f -p libjrtp.so ../../../../bin/release/GatewayServer/
	cp -f -p libjrtp.so ../../../../bin/release/AlmCenterServer/
	cp -f -p libjrtp.a ../../../../lib/
	@echo if unsuccess copy this .so file,please input:make makedir

jrtp.a:$(objects) 
	g++  -lc -shared -o libjrtp.so $(objects)  
	ar -r libjrtp.a $(objects)

$(objects):%.o:%.cpp 

#.PHONY clean is a unreal mark
.PHONY:cleanall cleanobj makedir makesvcdir
cleanall:
	-rm libjrtp.a libjrtp.so $(objects)

cleanobj:
	-rm $(objects) 

makedir:makesvcdir
	mkdir ../../../../bin
	mkdir ../../../../bin/release
	mkdir ../../../../lib
makesvcdir:
	mkdir ../../../../../bin/release/PMServer
	mkdir ../../../../../bin/release/MServer
	
	mkdir ../../../../../bin/release/RSServer
	mkdir ../../../../../bin/release/DecOnWallServer
	mkdir ../../../../../bin/release/AlmCenterServer
	mkdir ../../../../../bin/release/DevServer
	mkdir ../../../../../bin/release/NMServer
	mkdir ../../../../../bin/release/GuardServer
	mkdir ../../../../../bin/release/GatewayServer
	mkdir ../../../../../bin/release/AlmCenterServer
